package com.utils;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

public class ConnectionUtils {
    /**
     * 获取ES的rest客户端
     * @return
     */
    public static RestHighLevelClient getClient(){
        //建立连接
        RestClientBuilder builder = RestClient.builder(new HttpHost("10.9.12.200", 9078));
        return new RestHighLevelClient(builder);
    }
}
